import { useSelector, useDispatch } from "react-redux";

import { increment, decrement } from './store/actions/counter'

const App = () => {
  // @ts-ignore
  const count = useSelector((state) => state.count);
  const dispatch = useDispatch()
  return (
    <div className="app">
      计数器：{count}
      <button onClick={()=>dispatch(increment(2))}>加</button>
      <button onClick={()=>dispatch(decrement(5))}>减</button>
    </div>
  );
};

export default App;
